package org.liaohailong.victorlibrary.ui;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;

import org.jetbrains.annotations.Nullable;
import org.liaohailong.library.image.victor.Avatar;
import org.liaohailong.victorlibrary.R;
import org.liaohailong.victorlibrary.base.BaseActivity;

/**
 * Author: liaohailong
 * Date: 2019/7/14
 * Time: 20:24
 * Description:
 **/
public class NetImageActivity extends BaseActivity {
    private static final String TAG = "NetImageActivity";

    public static void show(Context context) {
        Intent intent = new Intent(context, NetImageActivity.class);
        context.startActivity(intent);
    }

    private String gifUrl = "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fitem%2F202002%2F13%2F20200213225906_hR2We.thumb.400_0.gif&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1663768344&t=7510b0d978b7b48580940a9da4c30f57";
    //    private String pngUrl = "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1563117386087&di=f50f6c0cd6c5c371a196a3b0a7e9b114&imgtype=0&src=http%3A%2F%2Fpic.rmb.bdstatic.com%2F839d60f092231e80e773060e48683193.png%40wm_2%2Ct_55m%2B5a625Y%2B3L%2BWwj%2BWik%2BivtOS6iw%3D%3D%2Cfc_ffffff%2Cff_U2ltSGVp%2Csz_29%2Cx_19%2Cy_19";
    private String pngUrl = "https://i0.hdslb.com/bfs/sycp/creative_img/201907/655808d4474142bcb1807363df7c230e.jpg";

    private int width = 1080;
    private int height = 1920;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_net_image);
        ImageView image1 = findViewById(R.id.image_1);
        ImageView image2 = findViewById(R.id.image_2);
        ImageView image3 = findViewById(R.id.image_3);
        ImageView image4 = findViewById(R.id.image_4);
        ImageView image5 = findViewById(R.id.image_5);

        Avatar.INSTANCE.displayImage(TAG, gifUrl, image1, width, height, null, null, null);
        Avatar.INSTANCE.displayImage(TAG, pngUrl, image2, width, height, null, null, null);
        Avatar.INSTANCE.displayImage(TAG, gifUrl, image3, width, height, null, null, null);
        Avatar.INSTANCE.displayImage(TAG, pngUrl, image4, width, height, null, null, null);
        Avatar.INSTANCE.displayImage(TAG, gifUrl, image5, width, height, null, null, null);
    }
}
